<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */


/**
 * Smarty notnull modifier plugin
 *
 * Type:     modifier<br>
 * Name:     notnull<br>
 * Purpose:  NOT NULL STRING, N/A
 * @link http://smarty.php.net/manual/en/language.modifier.strip.tags.php
 *          notnull (Smarty online manual)
 * @author   Monte Ohrt <monte at ohrt dot com>
 * @param string
 * @param boolean
 * @return string
 */
function smarty_modifier_notnull($string, $replace_with_space = true)
{
    if ($replace_with_space) {
        $string = preg_replace('!<[^>]*?>!', ' ', $string);
	}
	if( strlen($string) > 0 ) {
        return $string;
	} else {
        return 'N/A';
	}
}
//
?>
